package com.demo;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;

public class HuToolFileDemo {
    /**
    *   IOUtil
    * */

    public static void main(String[] args) {

        //文件copy
        BufferedInputStream in = FileUtil.getInputStream("D:/fileDemo/demo.xlsx");
        BufferedOutputStream out = FileUtil.getOutputStream("D:/fileDemo/demo2.xlsx");
        long copySize = IoUtil.copy(in, out, IoUtil.DEFAULT_BUFFER_SIZE);
        System.out.println(copySize);//文件字节
    }

}
